﻿using System.ComponentModel;
using System.Web.Services;
using System.Collections.Generic;
using System.Data;

namespace Fjaspx.WebService
{
    /// <summary>
    /// ROYcms_user 的摘要说明
    /// </summary>
    [WebService(Namespace = "Fjaspx.WebService.ROYcms_user")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class ROYcms_user : System.Web.Services.WebService
    {
        public Fjaspx.Sys.Model.ROYcmsConfig config = Fjaspx.Config.ROYcmsConfig.Get_Config();
        private readonly Fjaspx.Sys.Bll.ROYcms_user Bll = new Fjaspx.Sys.Bll.ROYcms_user();
        /// <summary>
        /// 会话密码
        /// </summary>
        private string _password;
        public string password
        {
            set { _password = value; }
            get { return _password; }
        }
        
        #region  成员方法

        /// <summary>
        /// 返回长查询数据总数 （分页用到）
        /// </summary>
        [WebMethod]
        public int GetCount(string strWhere)
        {
            return Bll.GetCount(strWhere);
        }
        /// <summary>
        /// 验证用户
        /// </summary>
        [WebMethod]
        public bool Exists(string username, string password)
        {
            return Bll.Exists(username, password);
        }
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        [WebMethod]
        public bool _Exists(string name)
        {
            return Bll.Exists(name);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        [WebMethod]
        public int Add(Fjaspx.Sys.Model.ROYcms_user model)
        {
            //if (password != config.password) { return 1; }
            //else
            //{
                return Bll.Add(model);
            //}
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(Fjaspx.Sys.Model.ROYcms_user model)
        {
            Bll.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public void Delete(int bh)
        {
            Bll.Delete(bh);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        [WebMethod]
        public Fjaspx.Sys.Model.ROYcms_user GetModel(int bh)
        {
            return Bll.GetModel(bh);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        [WebMethod]
        public Fjaspx.Sys.Model.ROYcms_user _GetModel(string username)
        {
            return Bll.GetModel(username);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>

        [WebMethod]
        public DataSet GetList(string strWhere)
        {
            return Bll.GetList(strWhere);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        #endregion  成员方法
    }
}
